package server;

import java.io.IOException;

/**
 * @Auther: Xing Fang Bin
 * @Date: 2021/08/12/14:25
 * @Description:
 */
public class LaGouServlet extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) {
        /*try {
            Thread.sleep(100000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }*/
        String content = "<h1>LaGouServlet doGet</h1>";
        try {
            response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void doPost(Request request, Response response) {
        String content = "<h1>LaGouServlet doPost</h1>";
        try {
            response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Override
    public void init() {

    }

    @Override
    public void destroy() {

    }
}
